Real-time clocks keep track of time that humans are aware of being seconds, minutes, hours, days, months and years. Low-current, real-time clocks (RTCs) are time keeping circuits and devices that provide an extremely low standby current, that permit longer life from a power supply such as a battery or other rechargeable power supply within an electronic device. An RTC can be read by other circuits or chips that are in need of the time, amount of time passed or an alarm based on time. For example, the software within a computer may request that the microprocessor or another device read the time from the RTC's storage or registers for use by other circuits or software.
Real-time clocks require a time base, beats or a frequency in order to calculate and determine how often to tick per second. If the time base or oscillator is not accurate, then the real-time clock's time will drift relative to absolute time. Thus, a number of different types of reference signals or oscillators have been used in order to provide the beat or frequency for a real-time clock. A reference signal is generally an oscillating signal of a particular frequency that is fed into a real-time clock and used as a basis for keeping the real-time calculated by and stored in the real-time clock circuit. The most often used reference signal for an RTC is an oscillator circuit. An oscillator circuit may be part of the real-time clock circuit, separate from the real-time clock yet provide an oscillation signal to the real-time clock or be generated from an external source and provided to a real-time clock circuit. The most commonly used oscillator is a crystal oscillator, which uses a quartz crystal that is off-chip. A crystal is tuned to a predetermined oscillation frequency, for example, 32768 Hz. Depending on the quality of the crystal oscillator the frequency may vary +/−10 ppm at room temperature (or by about 5 minutes per year). Common crystal oscillators may also vary based on temperature fluctuations between −40° to 85° C. by −150 ppm or by about 79 minutes per year. The larger the +/− ppm rating of the crystal the more inaccurate the crystal oscillation is and the less expensive the crystal.
A more accurate version of a 32.768 kHz crystal oscillator is a 32 kHz TCXO (Temperature Compensated Crystal Oscillator). A TCXO uses a crystal oscillator, but incorporates circuitry that compensates for the inaccuracies of the normal 32 kHz crystal oscillator. Thus, the output oscillation frequency of a TCXO is compensated for the +/− ppm average crystal oscillator error at room temperature as well as being compensated for the −150 ppm inaccuracies due to extreme temperature ranges. A 32 kHz TCXO may achieve an accuracy of +/−2 ppm between zero and 40° C., which calculates to about one minute per year of inaccuracy. In extreme temperatures like −40° C. to 185° C. the TCXO may only be inaccurate by about +/−3.5 ppm or 1.8 minutes per year. TCXOs are more expensive than regular 32 kHz crystal oscillator devices and for many situations are not economically feasible choices.
If the timing requirements of a device do not require an extremely accurate real-time clock, then ring oscillators, LC oscillators or RC oscillators may be used in such circumstances to produce an oscillation frequency or reference frequency for a real-time clock circuit. A drawback of ring oscillators, LC oscillators and RC oscillators is that they are inaccurate over time and temperature and also consume more current than a crystal oscillator circuit.
If an external input that is a more accurate and consistent reference frequency exists in or about a device, such an external input could be utilized as an input to a real-time clock circuit and used to clock the RTC device.
In the category of external input frequencies commonly used by a real-time clock circuit, there are a variety of very accurate external frequencies available. Potential accurate timing references that could be provided to an RTC circuit include a GPS signal, a WWVB 60 kHz RF transmission signal from a radio station near Fort Collins, Colo., a power line frequency of 50 or 60 Hz or a network time signal from an accurate network time connection. Although these accurate reference signals are very useful, their continuous availability for an RTC cannot be guaranteed. Thus, a backup timing reference is often required in an RTC circuit. RTC circuits are expected to have very low power requirements during operation. These days, many complex devices that require real-time clock circuitry are hand held and battery powered devices. The less current that each RTC chip, device or circuit in the hand held product draws means that the battery will run longer. Although some circuits within a hand held device can be powered down when not being used, a real-time clock cannot be powered down because it must run all the time to keep track of time on a continuous basis. Currently, an RTC circuit is considered to be a low power circuit if it draws less than 1 microamp. Thus, it is important that any improvements to a real-time clock do not significantly increase the current draw of the overall RTC device in order to provide better timing accuracy.
Furthermore, it is important to device designers that real-time clock circuitry is simple to implement so that undue time is not required to write additional software or firmware for or to trouble-shoot real-time clock circuitry installed within a device. Prior art real-time clocks that use an external frequency reference require designers to write code or to create special circuitry that detects losses of the external reference signal power and to instruct the real-time clock to switch over from using the more accurate external reference source to using a less accurate internal reference source. Furthermore, when an external reference is being used, it is important that there be automatic switching between an external accurate reference and an internal oscillation reference (for example, an on-board 32 kHz oscillator). When switching from an external reference signal to using an internal reference, sometimes glitching occurs during the switchover. Glitching introduces observable timing errors into a real-time clock's time. The accumulation of timing errors introduced during switchovers between the use of available and unavailable external reference signals adds to the inaccuracy of the prior art real-time clocks.
Prior solutions for making real-time clock circuitry more accurate have been, as discussed above, an RTC circuit that comprises an integrated 32 kHz TCXO that can provide a +/−2-3.5 ppm accuracy. Another prior RTC solution was to provide a device that requests manual synchronization of the real-time clock circuit via a microcontroller. This solution requires a microcontroller's program to repetitively correct the RTC time based on an accurate reference. Manual synchronization, thus, requires microcontroller processing time, which may slow or detract from the other functions that the microcontroller is responsible for in a device. A third prior solution for creating a more accurate real-time clock is to use an accurate external clock reference input when such an accurate clock reference is available and then switch to an on-board crystal oscillator circuit to provide a reference signal to the RTC circuitry when the more accurate external clock reference signal is not available. Such a device adds complexity and utilizes additional current with circuitry that measures the amplitude and frequency of the external clock reference input to determine whether the external clock reference is providing a valid external reference signal or whether the RTC should be clocked using the on-board crystal oscillator. Another problem with this type of prior art solution is that when switching from using the on-board crystal oscillator to the external clock input or vis-à-vis, up to about one second of instantaneous time error can be introduced during each switching event. Such prior art devices have difficulty sensing the loss of the more accurate reference input as well as performing a switchover between using the external reference signal input and the on-board crystal oscillator reference signal without producing an observable time delay or time error in the real-time clock circuit's overall time keeping accuracy.
Thus, what is needed is an RTC circuit or device that operates on a low-current of less than about 1 microamp that is inexpensive and easy to implement into other circuitry by a device designer. Furthermore, it would be advantageous to have an RTC device that does not require microcontroller support or additional software overhead that uses microcontroller processing time. Additional circuitry should not have to be designed by the circuit designer who ultimately uses and incorporates a real-time clock device with other circuitry in order for the RTC circuit or device to work properly. Furthermore, what is needed is a real-time clock that does not double count time or generate glitches switching between two or more oscillation reference signals. Furthermore, when switching between two references, no error should be produced due to a phase difference in the reference's signals at the time of switch over. In addition, the draw backs of needing complex circuits to help determine whether an external reference signal is valid or invalid in a simple low power manner need to be overcome.